
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections.Generic;
using System.Text;

using Swaf;
using Swaf.BizObj;
using Swaf.Gui;
using Swaf.Security;
using Syrinx.Gui;

namespace Syrinx.Gui
{
    /// <summary>
    /// 
    /// </summary>
    public class FileSysUploadBizProc : BaseBusinessProcess
    {

        public FileSysUploadBizProc(ActiveBizProc procState)
            :base(procState)
        {
		}

		protected override void getBizObjList()
		{
			m_retrievedCurrentBizObj = true;

            m_bizobjs = App.bizObjMgr.createList("FileSysFile");
			for (int p = 0; p < 6; p++)
				m_bizobjs.insertNew().put("id", p.ToString());
		}

		public override Privileges CurrentEditPrivilege
		{
			get { return Privileges.Delete; }
		}

		protected override void setupRuleNames()
		{
            base.m_updateBizObjRule = "updateFileSysFile";
		}

		public override void updateBizObj()
		{
			base.updateBizObj();
		}

		protected override object[] getUpdateBizRuleParameters(IBizObj bizObj)
		{
			string cacheName = (string)m_procState.get("cid");
			object dir = m_procState.get("dir");
			//object name = Cmn.IsEmpty((string)dir)?bizObj.get("file.name"):dir + "\\" + bizObj.get("file.name");
            bizObj.put("cacheName", cacheName);
            bizObj.put("parentName", dir);
			return new object[] {bizObj };
		}
    }
}
